|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectVehicle
public class Vehicle
Vehicle class is a structure of basic attributes for any vehicle. This class uses Color class to implement any possible vehicle colour.
Color| Constructor Summary | |
|---|---|
Vehicle(int licensePlate,
int year,
java.lang.String manufacturer,
java.lang.String model,
java.awt.Color colour,
int numDoors)
This method is a constructor for vehicle class. |
|
| Method Summary | |
|---|---|
java.lang.String |
getColour()
This method checks if colour is not null. |
int |
getLicensePlate()
This method |
java.lang.String |
getManufacturer()
This method |
java.lang.String |
getModel()
This method |
int |
getNumDoors()
This method |
int |
getYear()
This method |
void |
setColour(java.awt.Color colour)
The method updates the colour of the vehicle, after the input colour is checked and it is one of the legal colours. |
java.lang.String |
toString()
The method @return a string representation of a Vehicle. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Vehicle(int licensePlate,
int year,
java.lang.String manufacturer,
java.lang.String model,
java.awt.Color colour,
int numDoors)
year - manufacturer - model - colour - numDoors - | Method Detail |
|---|
public int getYear()
public java.lang.String getColour()
public void setColour(java.awt.Color colour)
colour - public java.lang.String getModel()
public java.lang.String getManufacturer()
public int getNumDoors()
public int getLicensePlate()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||